﻿using System;
using System.Web;
using System.Security.Principal;

using OnlineFamilyCalendar.UI.Presentation;
using OnlineFamilyCalendar.UI.Presentation.Views;

namespace OnlineFamilyCalendar.UI.Web
{
    public partial class Login : System.Web.UI.Page, ILoginView
    {
        private LoginPresenter presenter;

        protected void Page_Load(object sender, EventArgs e)
        {
            presenter = new LoginPresenter(this);
        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            presenter.Login();
        }

        public string Loginname
        {
            get
            {
                return txtLoginname.Text;
            }
        }

        public string Password
        {
            get
            {
                return txtPassword.Text;
            }
        }

        public IPrincipal UserPrincipal
        {
            set
            {
                Context.User = value;
            }
        }
    }
}
